package com.demo.pattern.singleton;

/**
 * @author sourire
 * @version 1.0
 * @date 2020/8/17 16:53
 */
public class SingletonTest07 {
    public static void main(String[] args) {
        Runtime runtime = Runtime.getRuntime();
        Runtime runtime1 = Runtime.getRuntime();

        SingleTon07 instance = SingleTon07.INSTANCE;
        SingleTon07 instance2 = SingleTon07.INSTANCE;
        System.out.println(runtime == runtime1);
        System.out.println("instance === " + instance.hashCode());
        System.out.println("instance2 === " + instance2.hashCode());
    }
}

//枚举

enum SingleTon07 {
    INSTANCE;
}
